/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ch01;

/**
 *
 * @author Administrator
 */
public class LoopDemo2 {
    public static void main(String args[]){
        int sum=0;
        for(int i=1;i<=100;i++){
            sum=sum+i;
            if(sum>=2000)break;
           
            
        }
        System.out.println(sum);
    }
    
}
